package com.jsj.domain;

import com.ruoyi.common.annotation.Excel;
import org.springframework.stereotype.Component;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;

@Component
public class Course {
    private int id;
    @Excel(name = "课程")
    @NotBlank(message = "课程名不能为空")
    @Size(min = 0, max = 250, message = "课程名长度不能超过250个字符")
    private String name;
    private int classId;
    private String teacherId;
    @Excel(name = "课程班级", targetAttr = "name")
    private Sclass sclass;
    @Excel(name = "任课教师", targetAttr = "nickname")
    private Teacher teacher;

    public Course() {
    }

    public Course(int id, String name, int classId, String teacherId, Sclass sclass, Teacher teacher) {
        this.id = id;
        this.name = name;
        this.classId = classId;
        this.teacherId = teacherId;
        this.sclass = sclass;
        this.teacher = teacher;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getClassId() {
        return classId;
    }

    public void setClassId(int classId) {
        this.classId = classId;
    }

    public String getTeacherId() {
        return teacherId;
    }

    public void setTeacherId(String teacherId) {
        this.teacherId = teacherId;
    }

    public Sclass getSclass() {
        return sclass;
    }

    public void setSclass(Sclass sclass) {
        this.sclass = sclass;
    }

    public Teacher getTeacher() {
        return teacher;
    }

    public void setTeacher(Teacher teacher) {
        this.teacher = teacher;
    }

    @Override
    public String toString() {
        return "Course{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", classId=" + classId +
                ", teacherId='" + teacherId + '\'' +
                ", sclass=" + sclass +
                ", teacher=" + teacher +
                '}';
    }
}
